function! InsertDate()
lua << EOF
local linenr = vim.window().line
local curline = vim.buffer()[linenr]
vim.buffer()[linenr] = os.date("** %Y-%m-%d ")
EOF
:execute "normal A"
endfunction

function! Done()
lua << EOF
local file_done = io.open("done","a+")
local finish_date = os.date("完成时间%Y-%m-%d-%H:%M ")
local linenr = vim.window().line
local curline = vim.buffer()[linenr].."(已完成)\n"
local finish_line = finish_date..curline
file_done:write(finish_line)
io.close(file_done)
EOF
execute "normal! dd"
endfunction
